Week 5: Maven, the project management tool

 

This week's online activity deals with Maven. 

 

1.     Complete the online activities you find here: http://maven.apache.org/users/index.html

If you run into problems downloading and installing Maven, just concentrate on this part: https://maven.apache.org/guides/getting-started/index.html

 

Check your understanding of these new concepts with this online Blackboard Quiz 



Question 1
How would you use Maven to automatically deploy your target JAR file to your team's remote repository?
	Configure the repository URL in the settings.xml file and authentication information for the repository in the POM file.
	Configure the repository URL in the POM file and authentication information for the repository in the settings.xml file.
	Configure the repository URL and the authentication information in the settings.xml file (correct)
	Configure the repository URL and the authentication information in the POM file

Question 2
The standard source tree created by Maven has
	A single directory to contain both application and test sources
	No directory for sources
	A directory for application sources only because testing happens after the project is finished
	A directory for test sources only
	A directory for application sources and a separate directory for test sources (correct)

Question 3
The Maven command for compiling test sources only, without executing the tests, is
	mvn comptest
	mvn test
	mvn test-compile (correct)
	mvn compile
	mvn ct

Question 4
What is the difference between the commands mvn package and mvn install?
	The mvn package command is the same as mvn install, except the former erases the JAR file afterwards
	Both commands do the same thing
	The mvn package command creates the artifact, for example a JAR file, and mvn install will install the artifact to a repository (correct)
	The mvn package command is the same as mvn install, except the latter erases the JAR file afterwards

Question 5
Which steps consitute the vast majority of what projects do with Maven?
	setting up, building, testing, packaging, and installing (correct)
	compiling, building, running
	compiling, building
	building, compiling, updating
	setting up, compiling, running

Question 6
The command used to run Maven on the command line is
	mvn (correct)
	maven
	make
	ant

Question 7	
Which of the following is not one of the key elements of a Maven POM file?
	groupId - indicates the unique identifier of the orgainization that created the project	
	artifactId - indicates the unique base name fo the primary artifact generated by the project (for example, a JAR file)
	project - the top-level element in all Maven pom.xml files
	modelVersion - the version of the object model this POM is using
	professor - the name of the professor teaching the course where Maven is being used (correct)

Question 8
If ${basedir} is the directory that contains the pom.xml file, how would you arrange for Maven to put a META-INF/application.properties file at the root of the target JAR file?
	Place the META-INF directory under ${basedir}/src/main/resources (correct)
	Run the command, mvn application.properties
	Place the META-INF directory under ${basedir}/src
	Place the META-INF directory under ${basedir}
	Place the META-INF directory under ${basedir}/src/main/java

Question 9
A Maven archetype is a
	A primitive mental image of a software project	
	Template of a project which is combined with some user input to produce a working Maven project (correct)
	Any developer who is not the software project lead
	The developer who acts as the software project lead

Question 10
What can be done with Maven if a resource file for a project contains a value that can only be supplied at build time?
	This cannot be done with Maven
	The resource file can include the syntax ${<property name>}, and Maven's filtering mechanism can replace that with the value of a property (correct)
	The resource file must be updated by hand after compiling
	The contents of the resource file is copied into the POM file where Maven's filting mechanism can reference it

Question 11
To specify that a project has a dependency on certain technology, for example, the JUnit framework, four things must be defined in the POM file, and those do NOT include which of the following?
	version
	scope
	packaging (correct)
	groupID
	artifactId

Question 12
When the mvn compile command is run to compile a project, it may take longer the first time because
	It takes time for Maven to load the POM file in memory the first time
	After compiling once, Maven refactors the application code so that it compiles faster
	Maven may need to download plugins and related dependencies for the project (correct)
	Maven needs to clear licensing authorization before it can compile a project the first time

Question 13
How would you use Maven to build more than one project at once?
	List all of the subprojects as modules in one designated subproject's pom.xml file
	Each project must be managed separately with Maven
	List all of the supprojects as modules in all of the subproject's pom.xml files
	Add a parent pom.xml file in the directory above the subprojects, and list the subprojects as modules in the parent pom.xml file (correct)

Question 14
The pom.xml file is
	A configuration file that is installed with Maven to control where Maven is stored
	A Project Object Model for a specific project, containing information about the project	(correct)
	The Maven licensing agreement
	A Maven project's User Interface configuration file

Question 15
Maven helps the build process for a software project by
	Making use of the GPU processor to accelerate the build
	Employing standard conventions and best practices (correct)
	All of the above
	Optimizing the compile phase so it takes less time